<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'addNews.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="<%=basePath%>fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>

</head>
<body>
	<center>
		<form action="<%=basePath%>servlet/NewsServlet?m=addNews" method="post" onsubmit="return check()">
			<table>
				<tr>
					<td>标题</td>
					<td><input type="text" name="title" id="title"></td>
					<td><p style="color: red;">*</p></td>
				</tr>
				<tr>
					<td>时间</td>
					<td><input class="Wdate" type="text" name="time" onClick="WdatePicker()" id="time" ></td>
					<td><p style="color: red;">*</p></td>
				</tr>
				<tr>
					<td>来源</td>
					<td><input type="text" name="source"></td>
				</tr>
				<tr>
					<td>作者</td>
					<td><input type="text" name="author"></td>
				</tr>
				<tr>
					<td>责任编辑</td>
					<td><input type="text" name="editor"></td>
				</tr>
				<tr>
					<td>内容</td>
					<td><script type="text/javascript">
						var myFCKeditor = new FCKeditor('FCKeditor');
						myFCKeditor.BasePath = "fckeditor/";
						myFCKeditor.Width = "700";
						myFCKeditor.Height = "300";
						myFCKeditor.ToolbarSet="Basic";
						myFCKeditor.Create();
					</script></td>
					<td><p style="color: red;">*</p></td>
				</tr>
				<tr>
					<td><input type="submit" value="提交"></td>
					<td><input type="reset" value="重置"></td>
				</tr>
			</table>
		</form>
	</center>
	<script type="text/javascript">
	function check() {
		var title = document.getElementById("title");
		var time = document.getElementById("time");
		if (title.value == "") {
			alert("标题不能为空！");
			return false;
		} else if (time.value == "") {
			alert("时间不能为空！");
			return false;
		} else {
			return true;
		}
	}
</script>
</body>
</html>
